package com.skynet.supervision.controller;

import com.skynet.supervision.beans.response.SysDictDataVo;
import com.skynet.supervision.beans.response.SysDictTypeVo;
import com.skynet.supervision.common.PageResults;
import com.skynet.supervision.common.Result;
import com.skynet.supervision.common.ResultGeneric;
import com.skynet.supervision.services.SysDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

@Api(tags = "字典管理")
@RestController
@RequestMapping(value = "/dict")
@Validated
public class DictController {

    private final SysDictService sysDictService;

    public DictController(SysDictService sysDictDataService) {
        this.sysDictService = sysDictDataService;
    }

//    @ApiOperation("添加字典类型")
//    @PostMapping("/addDictType")
//    public Result addDictType() {
//        this.sysDictService.addDictType(request);
//        return Result.success();
//    }
//    @ApiOperation("分页获取所有字典类型")
//    @PostMapping("/listPagedDictType")
//    public ResultGeneric<PageResults<SysDictTypeVo>> listSummaryPaged() {
//        return ResultGeneric.success(this.sysDictService.listPagedDictType(request));
//    }
//
//    @ApiOperation("获取所有字典")
//    @PostMapping("/allDictValues")
//    public ResultGeneric<List<DictDataListItem>> allDictValues() {
//        return ResultGeneric.success(this.sysDictService.allDictValues());
//    }
//
//    @ApiOperation("获取key下所有字典值")
//    @PostMapping("/listDictValues")
//    public ResultGeneric<List<SysDictDataVo>> listDictValues(@Valid @RequestBody listDictValuesRequest request) {
//        return ResultGeneric.success(this.sysDictService.listDictValues(request.getKey()));
//    }

}
